<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<title>项目管理工具</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link
	href="bootstrap-3.3.7-dist/css/bootstrap.min.css"
	rel="stylesheet">
<!-- <link
	href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css"
	rel="stylesheet"> -->
<!-- jQuery (Bootstrap 的 JavaScript 插件需要引入 jQuery) -->
<script src="bootstrap-3.3.7-dist/js/jquery.min.js"></script>
<!-- 包括所有已编译的插件 -->
<script src="bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
<script>
	$(function() {
		$(".dropdown-toggle").dropdown();
		
		//设置全局ajaxError处理
		/* $(document).ajaxError(function(){
			  alert("An error occurred!");
		}); */

		/* $("input:checkbox").click(
				function() {
					$(this).attr("disabled", "disabled");
					$(this).parent("label").css("text-decoration",
							"line-through");
					var missionid = $(this).parent().parent().parent().parent()
							.parent().children().find("a").attr("id");

					$.ajax({
						url : "CompleteMission.do?missionid=" + missionid,
						success : function(result) {
							alert(result);
						}
					});
					
				}); */

		/* 		$("a[name=project]").click(
		 function() {
		
		 var projectid = $(this).attr("id");
		 alert(projectid);
		 $("#sss").load("findMissionsByUrpid.do?projectId=" + projectid+ "&userId="+1+"&roleId="+1);
		 }); */

		$("a[name=team]")
				.click(
						function() {
							var teamid = $(this).attr("id");
							//alert(teamid);
							$.ajax({
										url : "findProjectsByUrpid.do?teamId="
												+ teamid + "&userId="+${currentUser.userId},
										dataType : "json",
										contentType : "application/x-www-form-urlencoded; charset=utf-8",
										success : function(projectlist) {
											var json = projectlist;
											$("#projectdropdown").html("");
											for (var i = 0; i < projectlist.length; i++) {
												$("#projectdropdown")
														.append(
																"<li><a href='javascript:;' onclick='loadmissionlist("
																		+ projectlist[i].projectId
																		+ ")' name='project' >"
																		+ projectlist[i].projectId
																		+ projectlist[i].projectName
																		+ "</a></li>");
											}
										}
									});
						});
	});

	function loadmissionlist(projectid) {
		//alert(projectid);
		$("#sss").load("gotoProjectOrMission.do?projectId=" + projectid);
	}
	/* $("input:radio[name=checkbox]").click(function () {
	    $(this).innerHTML="1";
		 alert(1);
	}); */
	/* $("#checkbox").change(function() {
		alert(1);
		$(this).innerHTML="hhhh";
	}); */
</script>
<style type="text/css">
body {
	margin: 0px;
	background: url(style/image/background/bangongshi4.jpg) no-repeat;
	background-size: 100% 100%;
	background-attachment: fixed;
	/* background: #DCDDDF
		url(http://cssdeck.com/uploads/media/items/7/7AF2Qzt.png);
	color: #000;
	font: 14px Arial;
	margin: 0 auto;
	padding: 0;
	position: relative; */
}
</style>
</head>
<body>

	<div class="container">
		<div class="row clearfix">
			<div class="col-md-12 column">
				<nav class="navbar navbar-default" role="navigation">
					<div class="navbar-header">
						<button type="button" class="navbar-toggle" data-toggle="collapse"
							data-target="#bs-example-navbar-collapse-1">
							<span class="sr-only">Toggle navigation</span><span
								class="icon-bar"></span><span class="icon-bar"></span><span
								class="icon-bar"></span>
						</button>

					</div>

					<div class="collapse navbar-collapse"
						id="bs-example-navbar-collapse-1">
						<ul class="nav navbar-nav">

							<li class="dropdown"><a href="#" class="dropdown-toggle"
								data-toggle="dropdown">项目管理工具<strong class="caret"></strong></a>
								<ul class="dropdown-menu">

									<li class="divider"></li>
									<li><a>切换团队</a></li>
									<li class="divider">切换团队</li>
									<c:forEach var="teams" items="${teamlist}">
									<li><a href="#" name="team" id="${teams.teamId}">${teams.teamName}</a></li>
									</c:forEach>
									<li class="divider">团队管理</li>
									<li><a href="gotoTeamList.do">团队管理</a></li>
								</ul></li>
						</ul>
						<ul class="nav navbar-nav" id="aa">

							<li class="dropdown"><a href="#" class="dropdown-toggle"
								data-toggle="dropdown">项目切换<strong class="caret"></strong></a>
								<ul id="projectdropdown" class="dropdown-menu">

									<li class="divider"></li>
									<li><a>切换项目</a></li>
									<li class="divider">切换项目</li>
									<li><a name="project" id="1">请选择团队</a></li>
								</ul></li>
						</ul>
						<ul class="nav navbar-nav navbar-right">
							<li><a href="pmuserinfo.jsp"><img	 src="${currentUser.headimage}" width="27" height="27">
							</a></li>
							<li><a href="pmuserinfo.jsp">HI!&nbsp;${currentUser.userName}</a></li>

							<li><a href="logout.do">注销</a></li>
						</ul>
					</div>

				</nav>
			</div>
		</div>



		<div id="sss" class="row clearfix">
			<!-- <div class="col-md-3 column">
				<ul class="nav nav-stacked nav-tabs">
					<li><a>任务</a></li>
	
				</ul>
			</div>
		

			<div class="col-md-9 column"></div> -->
			<h6>请选择所在团队及对应项目</h6>
		</div>
	</div>
</body>
</html>
